import request from "@/utils/http";

/*
 * 获取用户列表
 * @param {Object} data - 传入的参数对象 例如：{ page: 1, limit: 10} 等价于：GET https://api.example.com/users?page=1&limit=10
 * @returns {Promise}
 */
export function getUsers(data) {
    return request({
        url: '/protected',
        method: 'get',
        params: data
    })
}

// 登录
export function login(data) {
    return request({
        url: '/login',
        method: 'post',
        params: data
    })
}

export function register(data) {
    return request({
        url: '/register',
        method: 'post',
        params: data
    })
}